var app = new Vue({
    el: "#app",
    data: {
        query: "",
        musicList: [],
        musicUrl: "",
        musicCover: "",
        // 动画播放状态：
        isPlaying: false,
        isPauses: true,
        isShow: false,
        MvUrl: ""

    },
    methods: {
        searchMusic: function() {
            var that = this;
            axios.get("https://autumnfish.cn/search?keywords=" + this.query)
                .then(function(response) {
                        that.musicList = response.data.result.songs;
                        console.log(response.data.result.songs);
                    },
                    function(err) {}
                );
        },
        playerMusic: function(musicId) {
            // console.log(musicId);
            var that = this;
            axios.get("https://autumnfish.cn/song/url?id=" + musicId).then(
                function(response) {
                    // console.log(response.data.data[0].url);
                    that.musicUrl = response.data.data[0].url;
                },
                function(err) {}
            )
            axios.get("https://autumnfish.cn/song/detail?ids=" + musicId).then(
                function(response) {
                    // console.log(response.data.songs[0].al.picUrl);
                    that.musicCover = response.data.songs[0].al.picUrl;
                },
                function(err) {}
            )

        },
        play: function() {
            // console.log("play");
            this.isPlaying = true;
        },
        pause: function() {
            // console.log("pause");
            this.isPauses = false;

        },
        // mv播放
        playMv: function(mvid) {
            var that = this;
            axios.get("https://autumnfish.cn/mv/url?id=" + mvid).then(
                function(response) {
                    console.log(response.data.data.url);
                    isShow = true;
                    that.MvUrl = response.data.data.url;
                },
                function(err) {}
            )

        }

    }
});